package com.ts.admin.modules.content;

import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.ts.common.core.utils.Result;
import com.ts.feign.api.PostService;
import com.ts.feign.dto.PostDto;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RequestMapping("/post")
public class PostController {
    @Autowired
    PostService postService;

    @PostMapping("/page")
    public Result<Page> page(@RequestBody Page<PostDto> page){
        System.out.println(page.toString());
        Page<PostDto> page1 = postService.page(page);
        //return new Result<Page>().ok(page1);
        return new Result<>().ok1(page1);
        //return new Result<>().ok(page1);
    }
}
